<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Master Service Monitor</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <style>
        body.IE_M7, body.IE_M8, body.Win6{font-family:"Segoe UI", Tahoma, Verdana, Arial;}
        body.Safari{min-width:987px;}
        body.SF_iPhone{-webkit-text-size-adjust:none;}
        body
        {
            margin:0;font-family:Tahoma, Verdana, Arial;
            background-color:#FEFEFE;
            color:#333;
            font-size:12pt;
            width:100%;
            height:100%;
        }
        form{margin:0px;display: inline}
        #mainframe{position:relative;background-color:#FEFEFE;width:100%;height:100%;}
        #task{position:absolute;background-color:#F4FBFF;display:inline;
            border:1px solid #81BEF7;padding:0px;left:0px;top:0px;width:100%;height:100%;}
        .tasklist{position:relative;padding:0px; background-color:#D0E9F7;height:100%;}
        .tasktitle{position:relative;background-color:#2F5FA1;color:#c0c0c0; height:30px;}
        #taskselect{position:relative;background-color:#D0E9F7;color:#2F5FA1;width:100%;}
        #tasklists .tasklists{position:relative;background-color:#F4FBFF;color:#2F5FA1;}
        #records{position:relative;background-color:#FEFEFE;width:100%;height:700px;}
        .task-title{background-color:#2F5FA1;color:#c0c0c0;height:30px;width:100%;}
        .ultab{list-style:none;padding:0;margin:0;width:100%;}
        .ltabname{cursor:pointer;font-size:12pt;}
        .ltab{background-color:#D0E9F7;cursor: pointer;width:100%;}
        .ltab-selected{background-color:#F4FBFF;cursor: pointer;width:100%;}
        .lfname{cursor: pointer;}
        .ltask{background-color:#F4FBFF;cursor: pointer;}
        .ltask-selected{background-color:#D0E9F7;cursor: pointer;}
        #nodeform{position:absolute;width:700px;background-color:#ffffff;
            border:1px solid #81BEF7;padding:10px;z-index:99;overflow:auto;display:none;}
        #taskform{position:absolute;width:500px;height:50px;background-color:#ffffff;
            border:1px solid #81BEF7;padding-top:10px;padding-left:6px;font-size:12pt;
            color:#2F5FA1;z-index:99;overflow:auto;display:none;}
        .eadd{color:#5FB404;font-size:13pt;font-weight:bolder;cursor:pointer;}
        .eupdate{color:#FF8000;font-size:13pt;font-weight:bolder;cursor:pointer;}
        .edelete{color:#B4045F;font-size:13pt;font-weight:bolder;cursor:pointer;}
        .eview{color:#0000ff;font-size:13pt;font-weight:bolder;cursor:pointer;}
        .closetxt{cursor:pointer;font-size:10pt;color:#cccccc;text-align:right;}
        .ntask{display:inline;color:red;font-size:12pt;}
        </style>
        <script language='javascript'>
            var chradd = '✚', chrfold = '►', chrtree = '▼', chredit='✎', chrdel='✘', chrview = '☜ ';
            var base64EncodeChars = 
            "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
            var base64DecodeChars = new Array(
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
            -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
            -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
            41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
            function base64encode(str) 
            {
                var out, i, len;
                var c1, c2, c3;

                len = str.length;
                i = 0;
                out = "";
                while(i < len) {
                    c1 = str.charCodeAt(i++) & 0xff;
                    if(i == len)
                    {
                        out += base64EncodeChars.charAt(c1 >> 2);
                        out += base64EncodeChars.charAt((c1 & 0x3) << 4);
                        out += "==";
                        break;
                    }
                    c2 = str.charCodeAt(i++);
                    if(i == len)
                    {
                        out += base64EncodeChars.charAt(c1 >> 2);
                        out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
                        out += base64EncodeChars.charAt((c2 & 0xF) << 2);
                        out += "=";
                        break;
                    }
                    c3 = str.charCodeAt(i++);
                    out += base64EncodeChars.charAt(c1 >> 2);
                    out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
                    out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
                    out += base64EncodeChars.charAt(c3 & 0x3F);
                }
                return out;
            }
            function base64decode(str)
            {
                var c1, c2, c3, c4;
                var i, len, out;

                len = str.length;
                i = 0;
                out = "";
                while(i < len) {
                    /* c1 */
                    do {
                        c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
                    } while(i < len && c1 == -1);
                    if(c1 == -1)
                    break;

                    /* c2 */
                    do {
                        c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
                    } while(i < len && c2 == -1);
                    if(c2 == -1)
                    break;

                    out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));

                    /* c3 */
                    do {
                        c3 = str.charCodeAt(i++) & 0xff;
                        if(c3 == 61)
                        return out;
                        c3 = base64DecodeChars[c3];
                    } while(i < len && c3 == -1);
                    if(c3 == -1)
                    break;

                    out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));

                    /* c4 */
                    do {
                        c4 = str.charCodeAt(i++) & 0xff;
                        if(c4 == 61)
                        return out;
                        c4 = base64DecodeChars[c4];
                    } while(i < len && c4 == -1);
                    if(c4 == -1)
                    break;
                    out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
                }
                return out;
            }
            function utf16to8(str)
            {
                var out, i, len, c;
                out = "";
                len = str.length;
                for(i = 0; i < len; i++) {
                    c = str.charCodeAt(i);
                    if ((c >= 0x0001) && (c <= 0x007F)) {
                        out += str.charAt(i);
                        } else if (c > 0x07FF) {
                        out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
                        out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));
                        out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
                        } else {
                        out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));
                        out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
                    }
                }
                return out;
            }
            function utf8to16(str)
            {
                var out, i, len, c;
                var char2, char3;
                out = "";
                len = str.length;
                i = 0;
                while(i < len) {
                    c = str.charCodeAt(i++);
                    switch(c >> 4)
                    { 
                        case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
                        // 0xxxxxxx
                        out += str.charAt(i-1);
                        break;
                        case 12: case 13:
                        // 110x xxxx   10xx xxxx
                        char2 = str.charCodeAt(i++);
                        out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
                        break;
                        case 14:
                        // 1110 xxxx  10xx xxxx  10xx xxxx
                        char2 = str.charCodeAt(i++);
                        char3 = str.charCodeAt(i++);
                        out += String.fromCharCode(((c & 0x0F) << 12) |
                        ((char2 & 0x3F) << 6) |
                        ((char3 & 0x3F) << 0));
                        break;
                    }
                }

                return out;
            }
            function start_wait()
            {
                document.body.style.cursor = 'wait';
            }
            function over_wait()
            {
                document.body.style.cursor = 'auto';
            }
            function base64strdecode(str)
            {
                return utf8to16(base64decode(str));
            }
            function trim(str)
            {
                return str.replace(/(^\s+|\s+$)/, "");
            }
            function removeElement(_element)
            {
                var _parentElement = _element.parentNode;
                if(_parentElement)
                {
                    _parentElement.removeChild(_element);  
                }
                return hideBFrame();
            }
            function onDiv(div, cssName)
            {
                div.className = cssName;
            }
            function outDiv(div, cssName)
            {
                div.className = cssName;
            }
            function CreateXMLHTTP()
            {
                var xmlhttp = null;
                xmlhttpObj = ["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0",
                "MSXML2.XmlHttp.3.0","MSXML2.XmlHttp","Microsoft.XmlHttp"];
                if(window.XMLHttpRequest)
                {
                    xmlhttp = new XMLHttpRequest();
                }
                else if(window.ActiveXObject)
                {
                    for(i=0;i<xmlhttpObj.length;i++)    
                    {
                        try{xmlhttp = new ActiveXObject(xmlhttpObj[i]);break;}
                        catch(e){xmlhttp = null;}
                    }
                }
                else 
                {
                    alert('Can not create XMLHTTP Object');
                }
                return xmlhttp;
            }
            //hide result
            function hideresult()
            {
                obj = document.getElementById('resinfo');
                obj.innerHTML = "";
                obj = document.getElementById('records');
                obj.innerHTML = "";
                obj = document.getElementById('page');
                obj.innerHTML = "";
                obj = document.getElementById('pagetop');
                obj.innerHTML = "";
            }
            function isoDateTime(time)
            {
                var datetime = new Date(time * 1000);
                var year = datetime.getFullYear();
                var mon = datetime.getMonth()+1;if(parseInt(mon) < 10) mon = "0"+mon;
                var day = datetime.getDate();if(parseInt(day) < 10) day = "0"+day;
                var hour = datetime.getHours();if(parseInt(hour) < 10) hour = "0"+hour;
                var min = datetime.getMinutes();if(parseInt(min) < 10) min = "0"+min;
                var sec = datetime.getSeconds();if(parseInt(sec) < 10) sec = "0"+sec;
                return year+"-"+mon+"-"+day+" "+hour+":"+min+":"+sec;
            }
            //display
            function display(text, page, debug)
            {
                var catlist = ["娱乐","乐活","搞笑", "动画","游戏","音乐","体育","科技",
                "电影","财富","教育","汽车","女性","热点","电视剧","原创", "综艺","","","",
                "短","中","长","","",
                "高清", "非高清", "视频", "音频", "", "", ""];
                var html = "";
                var res = null;
                var catgroups = null;
                var opage = document.getElementById('page');
                var opagetop = document.getElementById('pagetop');
                var orecords = document.getElementById('records');
                var oresinfo = document.getElementById('resinfo');
                var records = null;
                var datetime = null;
                var i = 0, from = 0, to = 0, page_count = 0, catid = 0;
                var comments = "";

                if((res = eval(text)))
                {
                    if(window.location.href.indexOf('displayres=1') >= 0)alert(text);
                    if(debug)
                    {
                        html = "<textarea cols=100 rows=60 >"+text+"</textarea>";
                        oresinfo.innerHTML = html;
                    }
                    else
                    {
                        //alert(res['count']);
                        html = "";
                        html += "结果:<span class='highlight'>"+res['count']+"</span>"; 
                        html += "&nbsp;&nbsp;";
                        html += "命中:<span class='highlight'>"+res['total']+"</span>"; 
                        html += "&nbsp;&nbsp;";
                        html += "IO时间:<span class='highlight'>"+res['io']+"</span>"; 
                        html += "&nbsp;&nbsp;";
                        html += "排序时间:<span class='highlight'>"+res['sort']+"</span>"; 
                        html += "&nbsp;&nbsp;";
                        html += "总文档数:<span class='highlight'>"+res['doctotal']+"</span>"; 
                        html += "&nbsp;&nbsp;";
                        if((catgroups = res['catgroups']))
                        {
                            for(x in catgroups)
                            {
                                html += catlist[x]+"[<font color=red >"+catgroups[x]+"</font>]";
                                html += "&nbsp;&nbsp;";
                            }
                        }
                        html += "&nbsp;&nbsp;<hr><br>";
                        oresinfo.innerHTML = html;
                        /* show records */
                        if(res['count'] > 0 && (records = res['records']))
                        {
                            html = "<div style='border:1px;border-color:#000000;'>";
                            html += "<table align=left >";
                            for (x in records)
                            {
                                img = records[x]['summary']['17'];
                                html += "<tr ><td width=100 >";
                                if(img) html += "<img src='"+img+"' border=0 >";
                                    html += "</td><td width=800 >";
                                    html += "["+x+"]&nbsp;";
                                    html += "标题:&nbsp;"+records[x]['summary']['0']+"";
                                    html += "&nbsp;";
                                    html += "关键字:&nbsp;"+records[x]['summary']['2']+"<br>";
                                    html += "播放次数:["+records[x]['summary']['6']+"]";
                                    html += "&nbsp;";
                                    html += "上传时间:["+isoDateTime(records[x]['summary']['3'])+"]";
                                    html += "&nbsp;";
                                    html += "视频时长:["+records[x]['summary']['4']+"]";
                                    html += "&nbsp;";
                                    html += "高清:["+records[x]['summary']['5']+"]";
                                    html += "<br>";
                                    html += "ID:["+records[x]['summary']['8']+"]";
                                    html += "&nbsp;";
                                    html += "score:["+records[x]['score']+"]";
                                    html += "&nbsp;";
                                    html += "rank:["+records[x]['rank']+"]";
                                    html += "&nbsp;";
                                    catid = parseInt(records[x]['summary']['11']);
                                    html += "频道:["+catlist[catid]+"]";
                                    html += "&nbsp;";
                                    html += "上传者ID:["+records[x]['summary']['9']+"]";
                                    html += "用户名:["+records[x]['summary']['1']+"]<br>";
                                    html += "<br>";
                                    html += "<hr></td></tr>";
                            }
                            html += "</table></div>";
                        orecords.innerHTML = html;
                    }
                    /* paging */
                    if((total = 1 * res['total']) > 15)
                    {
                    page_count = parseInt(total/15);
                    if(total%15) page_count++;
                    from = page - 10;
                    to = page + 10;
                    if(from < 1) from = 1;
                    if(to > page_count) to = page_count;
                    html = "";
                    if(page > 15)
                    html += "<a href='javascript:so(1)'>1</a>  ...  ";
                    for(i = from; i <= to; i++)
                    {
                    if(i == page)
                    html += i;
                    else
                    html += "<a href='javascript:so("+i+")'>"+i+"</a>";
                    html += "&nbsp;&nbsp;";
                    }
                    if(page < (page_count - 15))
                    html += " ...   <a href='javascript:so("+page_count+")'>"+page_count+"</a>";
                    opagetop.innerHTML = html+"<hr><br>";
                    opage.innerHTML = "<br>"+html;
                    }
                    }
                }
                else alert("没有找到相关的结果");
            }
            //so
            function so(page)
            {
                var xmlHttp = null;
                var query = "";
                var page_num = page;
                var form = document.forms['search'];
                var fieldsfilter = 0;
                var n = 0;
                var from = 0;
                var count = 15;
                var catfilter = 0;
                var orderby = 0;
                var order = 0;
                var datetime = null;
                var datefrom = 0;
                var dateto = 0;
                if((form && (query = form['query'].value) != "")
                && (xmlHttp = CreateXMLHTTP()) != null)
                {
                    if(page <= 0) page_num = 1;
                    from = (page_num - 1) * 15;
                    hideresult();
                    var uri = "/s?";
                    var not_str = "";
                    uri += "display=0$,1$,2$,3,4,5,6,7,8,9,10,11,17";
                    uri += "&hitscale=";
                    for(i = 1; i <= 32; i++)
                    {
                        form['h'+i].value;
                        if(i < 32)uri += form['h'+i].value+",";
                        else uri += form['h'+i].value;
                    }
                    var slevel = 0;
                    var i = 0;
                    for(i = 0; i < 32; i++)
                    {
                        if(form['s'+i] && form['s'+i].checked == true)
                        {
                            slevel |= 1 << i;
                        }
                    }
                    if((order = form['order'].value) != 0)
                        uri += "&order="+order;
                    if(form['phrase'].checked == true)
                        uri += "&phrase=1";
                    if(form['catgroup'].checked == true)
                        uri += "&catgroup=1";
                    if(form['rank'].checked == true)
                        uri += "&rank=1";
                    if(form['rel'].checked) uri += "&rel=1";
                    if(form['qfunc'][0].checked) uri += "&qfunc=1";
                    else if(form['qfunc'][1].checked) uri += "&qfunc=2";
                    var qfhits = 0;
                    if(form['t0'].checked) qfhits = 1;
                    if(form['t1'].checked) qfhits |= 1 << 1;
                    if(form['t2'].checked) qfhits |= 1 << 2;
                    uri += "&qfhits="+qfhits;
                    if(form['booland'].checked == true)  uri += "&booland=1";
                    uri += "&bhits="+form['bhits'].value;
                    uri += "&bfhits="+form['bfhits'].value;
                    uri += "&bphrase="+form['bphrase'].value;
                    uri += "&bnterm="+form['bnterm'].value;
                    uri += "&bxcatup="+form['bxcatup'].value;
                    uri += "&bxcatdown="+form['bxcatdown'].value;
                    uri += "&brank="+form['brank'].value;
                    uri += "&query="+encodeURI(query);
                    if((not_str = form['not_str'].value))
                        uri += "&not="+encodeURI(not_str);
                    if(slevel != 0) uri += "&slevel="+slevel;
                    else uri += "&slevel=-1";
                    if((fieldsfilter = form['fieldsfilter'].value) > 0)
                        uri += "&fieldsfilter="+fieldsfilter;
                    if((n = form['catfilter'].value) >= 0)
                        catfilter |= (1 << n*1);
                    if((n = form['times'].value) >= 0)
                        catfilter |= (1 << n*1);
                    if(form['h264'].checked == true)
                        catfilter |= (1 << 25*1);
                    if(catfilter)
                    {
                        uri += "&catfilter="+catfilter;
                    }
                    if((orderby = form['orderby'].value) > 0)
                        uri += "&orderby="+orderby;
                    var xup = 0, xdown = 0;
                    for(i = 0; i < 32; i++)
                    {
                        if(form['x'+i])
                        {
                            if(form['x'+i][0].checked)
                                xup |= 1 << i;
                            else if(form['x'+i][1].checked)
                                xdown |= 1 << i;
                        }
                    }
                    uri += "&xup="+xup+"&xdown="+xdown;
                    if((form['datefrom'].value) || (form['dateto'].value))
                    {
                        if(form['datefrom'].value)
                        {
                            datetime = new Date(form['datefrom'].value); 
                            datefrom =  datetime.getTime()/1000;
                        }
                        if(form['dateto'].value)
                        {
                            datetime = new Date(form['dateto'].value); 
                            dateto =  datetime.getTime()/1000;
                        }
                        if(dateto && dateto < datefrom) 
                        {
                            alert("时间范围不规范,终止时间必须大于起始时间");
                            return ;
                        }
                        uri += "&rangefilter=3:["+datefrom+","+dateto+"]";
                    }
                    uri += "&from="+from+"&count=15";
                    if(form['debug'].checked == true) uri += "&debug=1"
                    if(window.location.href.indexOf('displayuri=1') >= 0)alert(uri);
                    xmlHttp.open('GET', uri, true);
                    //xmlHttp.setRequestHeader("Content-Length", argv.length);
                    //xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                    xmlHttp.onreadystatechange=function()
                    {
                        if(xmlHttp.readyState==4)
                        {
                            if(xmlHttp.status == 200)
                            {
                                display(xmlHttp.responseText, page_num, form['debug'].checked);
                            }
                        }
                    }
                    xmlHttp.send();
                }else alert("请输入关键词");
            }
            //close form
            function CloseThis(element)
            {
                element.parentNode.parentNode.style.display = "none";
            }
            //hidden NodeForm
            function HideNodeform()
            {
                var div = document.getElementById('nodeform');
                if(div)div.style.display = 'none';
                var nodelist = document.getElementById('nodelists');
                if(nodelist) nodelist.innerHTML = "";
                return true;
            }
            function NodeXAdd(e)
            {
                e = e || window.event;
                var element = e.target || e.srcElement;
                var x = e.clientX + document.body.scrollLeft;
                var y = e.clientY + document.body.scrollTop;
                var Xdiv =  document.getElementById("nodeform");
                Xdiv.style.left = x;
                Xdiv.style.top = y + 10;
                Xdiv.style.display = 'inline';
                //overBFrame(Xdiv);
                var form = document.forms["nodeform"];
                form['op'].value = 1;
                form['limit'].value = 256;
                form['ip'].focus();
                form['ip'].value = '';
            }
            //list nodes 
            function ListNodes(txt)
            {
                var nodelist = document.getElementById('nodelists');
                var nodes = null;
                var res = null;
                var html = "", css = "";
                if(txt && (res = eval(txt)) && nodelist)
                {
                    nodelist.innerHTML = "";
                    if((nodes = res['nodes']) && res['count'] > 0)
                    {
                        var html = "<ul class='ultab'>";
                        for(x in nodes)
                        {
                            var limit = nodes[x]['limit'];
                            var ip = nodes[x]['ip'];
                            var port = nodes[x]['port'];
                            var nodetype = nodes[x]['type'];
                            html += "<li class='ltab' onmousemove=\"onDiv(this, 'ltab-selected')\"";
                            html += " onmouseout=\"outDiv(this, 'ltab')\" >";
                            html += "<form style='' action='javascript:void(0)' ";
                            html += " onsubmit='return NodeEdit(this);'>"
                            if(nodetype == 1) html += "Parser[";
                            else if(nodetype == 2) html += "Doc[";
                            else  html += "Index[";
                            html += ip+":"+port;
                            html += "]&nbsp;";
                            html += "<input type=hidden name='nodeid' value='"+x+"'>";
                            html += "<input type=hidden name='op' value='4'>";
                            html += "<input type=text name='limit' size=6 value='"+limit+"'>";
                            html += "&nbsp;&nbsp;";
                            html += "<span class='edelete' title='Delete' ";
                            html += " onclick=\"NodeDel("+x+")\">"+chrdel+"</span>";
                            html += "</form></li>";
                        }
                        html += "</ul>";
                        nodelist.innerHTML = html;
                    }
                    //alert(txt);
                }
            }
            //list 
            function list()
            {
                var xmlHttp = null;
                if((xmlHttp = CreateXMLHTTP()) != null)
                {
                    HideNodeform();
                    var argv = "op=8";
                    //alert(argv);
                    xmlHttp.open('POST', '/', true);
                    xmlHttp.setRequestHeader("Content-Length", argv.length);
                    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                    xmlHttp.onreadystatechange=function()
                    {
                        if(xmlHttp.readyState==4)
                        {
                            if(xmlHttp.status == 200)
                            {
                                ListNodes(xmlHttp.responseText);
                            }
                        }
                    }
                    xmlHttp.send(argv);
                }
            }
            //change port
            function changePort(form)
            {
                var i = 0;
                var portlist = ["0", "3515", "3824", "", "3721"];
                var bkportlist = ["0", "3103", "3412", "", "3309"];
                var o = form
                if(form && (o = form['type']) && (i = o.options[o.selectedIndex].value) > 0)
                {
                    form['port'].value = portlist[i];
                }
            }
            //add
            function NodeEdit(form)
            {
                var xmlHttp = null;
                var ip = "";
                var nodetype = -1;
                var nodeid = -1;
                var port = -1;
                var limit = -1;
                var argv = "";
                if(form && (op = form['op'].value) > 0)
                {
                    if(op == 1 && (nodetype = form['type'].value) > 0
                        && (limit = form['limit'].value) > 0
                        && (ip = form['ip'].value) != "" 
                        && (port = form['port'].value) > 0)
                    {
                        argv = "op=1&ip="+ip+"&port="+port+"&type="
                            +nodetype+"&limit="+limit;
                    }
                    else if(op == 4 && (nodeid = form['nodeid'].value) >= 0 
                        && (limit = form['limit'].value) > 0)
                    {
                        argv = "op=4&nodeid="+nodeid+"&limit="+limit;
                    }
                }else alert("请输入正确的数据");
                if(argv && (xmlHttp = CreateXMLHTTP()) != null)
                {
                    HideNodeform();
                    //alert(argv);
                    xmlHttp.open('POST', '/', true);
                    xmlHttp.setRequestHeader("Content-Length", argv.length);
                    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                    xmlHttp.onreadystatechange=function()
                    {
                        if(xmlHttp.readyState==4)
                        {
                            if(xmlHttp.status == 200)
                            {
                                ListNodes(xmlHttp.responseText);
                            }
                        }
                    }
                    xmlHttp.send(argv);
                }
            }
            //del node
            function NodeDel(nodeid)
            {
                var argv = "op=2&nodeid="+nodeid;
                if(argv && confirm("确认删除该节点?") && (xmlHttp = CreateXMLHTTP()) != null)
                {
                    HideNodeform();
                    //alert(argv);
                    xmlHttp.open('POST', '/', true);
                    xmlHttp.setRequestHeader("Content-Length", argv.length);
                    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                    xmlHttp.onreadystatechange=function()
                    {
                        if(xmlHttp.readyState==4)
                        {
                            if(xmlHttp.status == 200)
                            {
                                ListNodes(xmlHttp.responseText);
                            }
                        }
                    }
                    xmlHttp.send(argv);
                }
            }
            function clear_cache(obj)
            {
                    var xmlhttp = null;
                    var uri = "op=16";
                    if((xmlHttp = CreateXMLHTTP()) != null)
                    {
                        obj.disabled = true;
                        xmlHttp.open('POST', "/", true);
                        xmlHttp.setRequestHeader("Content-Length", uri.length);
                        xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                        xmlHttp.onreadystatechange=function()
                        {
                            if(xmlHttp.readyState==4)
                            {
                                if(xmlHttp.status == 200)
                                {
                                    alert("操作成功!");
                                    obj.disabled = false;
                                }
                            }
                        }
                        xmlHttp.send(uri);
                    }
                    else alert("请求失败!");
            }
            function operations(obj)
            {
                var xmlhttp = null;
                var uri = "";
                if(obj.value == '暂停')
                {
                    obj.value = '恢复';
                    uri = "op=32";
                }
                else if(obj.value == '恢复')
                {
                    uri = "op=64";
                    obj.value = '暂停';
                }
                if((xmlHttp = CreateXMLHTTP()) != null)
                {
                    obj.disabled = true;
                    xmlHttp.open('POST', "/", true);
                    xmlHttp.setRequestHeader("Content-Length", uri.length);
                    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                    xmlHttp.onreadystatechange=function()
                    {
                        if(xmlHttp.readyState==4)
                        {
                            if(xmlHttp.status == 200)
                            {
                                alert("操作成功!");
                                obj.disabled = false;
                            }
                        }
                    }
                    xmlHttp.send(uri);
                }
                else alert("请求失败!");
            }
            list();
        </script>
    </head>
    <!-- <body onload='javascript:loadInit();'> -->
    <body align=center >
    <div id='mainframe'>
    <div id='task'>
        <div id=task-header ></div>
            <table width=100% height=100% cellspacing=0 border=0 valign=top align=left >
                <tr>
                    <td class='tasklist' valign=top width=300 height=100% >
                        <table cellspacing=0 border=0 valign=top align=left width=100% >
                            <tr>
                                <td valign=top class='tasktitle' width=100% >
                                点击<span class='eadd' title='Add' onclick='NodeXAdd(event)'> ✚ </span>添加(检索/文档)节点</div>
                            </td>
                        </tr>
                        <tr>
                            <td valign=top width=100% >
                                <div id='nodelists'></div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td height=100% >
                <table valign=top height=100% width=100%>
                    <tr>
                    <td height=100 valign=top class='tasktitle'>
                    <form name=search action='javascript:void(0)' onsubmit="return so(1);">
                        <select name='catfilter'>
                            <option value='-1' selected>选择分类</option>
                            <option value='0' >娱乐</option>
                            <option value='1' >乐活</option>
                            <option value='2' >搞笑</option>
                            <option value='3' >动画</option>
                            <option value='4' >游戏</option>
                            <option value='5' >音乐</option>
                            <option value='6' >体育</option>
                            <option value='7' >科技</option>
                            <option value='8' >电影</option>
                            <option value='9' >财富</option>
                            <option value='10' >教育</option>
                            <option value='11' >汽车</option>
                            <option value='12' >女性</option>
                            <option value='13' >热点</option>
                            <option value='14' >电视剧</option>
                            <option value='15' >原创</option>
                            <option value='16' >综艺</option>
                        </select>
                        <select name='times'>
                            <option value='-1' selected>选择时长</option>
                            <option value='20' >短</option>
                            <option value='21' >中</option>
                            <option value='22' >长</option>
                        </select>
                        &nbsp;
                    <select name='fieldsfilter'>
                        <option value='-1' selected>选择字段</option>
                        <option value='1'>标题</option>
                        <option value='2'>用户名</option>
                        <option value='4'>tags</option>
                    </select>
                    &nbsp;
                    <select name='orderby'>
                        <option value='-1' selected>排序字段</option>
                        <option value='3'>上传时间</option>
                        <option value='4'>视频时长</option>
                        <option value='6'>播放次数</option>
                    </select>
                    <select name='order'>
                        <option value='-1' selected>降序</option>
                        <option value='1'>升序</option>
                    </select>
                    <input type=checkbox name='h264'>高清
                    &nbsp;
                    <input type=checkbox name='phrase' checked>句子检索
                    &nbsp;
                    <input type=checkbox name='catgroup' checked>聚类
                    &nbsp;
                    <input type=checkbox name='rank' checked>Rank
                    &nbsp;
                    命中加权:<input type=checkbox name='t0' checked>标题
                    <input type=checkbox name='t1'>用户名
                    <input type=checkbox name='t2'>tags
                    &nbsp;
                    <input type=button name='clearcache' onclick="clear_cache(this)" value='清除缓存'>
                    &nbsp;
                    <input type=button name='ops' onclick="operations(this)" value='暂停'>
                    <hr>
                    时间范围:从<input type=text name='datefrom' size=16 >&nbsp;到&nbsp;<input type=text name='dateto' size=16 >(格式:2010-05-10)
                    <hr>
                    排序优先:
                    娱乐[<input type=radio name='x0'>↑<input type=radio name='x0'>↓]
                    乐活[<input type=radio name='x1'>↑<input type=radio name='x1'>↓]
                    搞笑[<input type=radio name='x2'>↑<input type=radio name='x2'>↓]
                    动画[<input type=radio name='x3'>↑<input type=radio name='x3'>↓]
                    游戏[<input type=radio name='x4'>↑<input type=radio name='x4'>↓]
                    音乐[<input type=radio name='x5'>↑<input type=radio name='x5'>↓]
                    体育[<input type=radio name='x6'>↑<input type=radio name='x6'>↓]
                    科技[<input type=radio name='x7'>↑<input type=radio name='x7'>↓]
                    <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    电影[<input type=radio name='x8'>↑<input type=radio name='x8'>↓]
                    财富[<input type=radio name='x9'>↑<input type=radio name='x9'>↓]
                    教育[<input type=radio name='x10'>↑<input type=radio name='x10'>↓]
                    汽车[<input type=radio size=1 name='x11'>↑<input type=radio name='x11'>↓]
                    女性[<input type=radio name='x12'>↑<input type=radio name='x12'>↓]
                    热点[<input type=radio name='x13'>↑<input type=radio name='x13'>↓]
                    电视剧[<input type=radio name='x14'>↑<input type=radio name='x14'>↓]
                    原创[<input type=radio name='x15'>↑<input type=radio name='x15'>↓]
                    综艺[<input type=radio name='x16'>↑<input type=radio name='x16'>↓]
                    <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    短[<input type=radio name='x20'>↑<input type=radio name='x20'>↓]
                    中[<input type=radio name='x21'>↑<input type=radio name='x21'>↓]
                    长[<input type=radio name='x22'>↑<input type=radio name='x22'>↓]
                    高清[<input type=radio name='x25'>↑<input type=radio name='x25'>↓]
                    非高清[<input type=radio name='x26'>↑<input type=radio name='x26'>↓]
                    视频[<input type=radio name='x27'>↑<input type=radio name='x27'>↓]
                    音频[<input type=radio name='x28' value='1'>↑<input type=radio name='x28' checked=true>↓]
                    <br/>
                    安检级别:
                    &nbsp;<input type=checkbox name='s0' checked>0
                    &nbsp;<input type=checkbox name='s1' checked>1
                    &nbsp;<input type=checkbox name='s2' checked>2
                    &nbsp;<input type=checkbox name='s3' checked>3
                    &nbsp;<input type=checkbox name='s4' checked>17
                    &nbsp;<input type=checkbox name='s5' checked>19
                    &nbsp;<input type=checkbox name='s6' checked>20
                    &nbsp;<input type=checkbox name='s7' checked>21
                    &nbsp;<input type=checkbox name='s8' checked>22
                    &nbsp;<input type=checkbox name='s9' checked>23
                    &nbsp;<input type=checkbox name='s10' checked>26
                    &nbsp;<input type=checkbox name='s11' checked>27
                    &nbsp;<input type=checkbox name='s12' checked>28
                    &nbsp;<input type=checkbox name='s13' checked>29
                    &nbsp;<input type=checkbox name='s14' checked>30
                    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    &nbsp;<input type=checkbox name='s15' checked>31
                    &nbsp;<input type=checkbox name='s16' checked>24
                    &nbsp;<input type=checkbox name='s17' checked>36
                    &nbsp;<input type=checkbox name='s18' checked>37
                    &nbsp;<input type=checkbox name='s19' checked>38
                    &nbsp;<input type=checkbox name='s20' checked>39
                    &nbsp;<input type=checkbox name='s21' checked>40
                    &nbsp;<input type=checkbox name='s22' checked>41
                    &nbsp;<input type=checkbox name='s23' checked>42
                    &nbsp;<input type=checkbox name='s24' checked>43
                    &nbsp;<input type=checkbox name='s25' checked>44
                    &nbsp;<input type=checkbox name='s26' checked>45
                    &nbsp;<input type=checkbox name='s27' checked>46
                    <hr>
                命中控制:
                1:<input type=text name=h1 value='0' size=1>
                2:<input type=text name=h2 value='50' size=1>
                3:<input type=text name=h3 value='55' size=1>
                4:<input type=text name=h4 value='55' size=1>
                5:<input type=text name=h5 value='60' size=1>
                6:<input type=text name=h6 value='60' size=1>
                7:<input type=text name=h7 value='65' size=1>
                8:<input type=text name=h8 value='65' size=1>
                9:<input type=text name=h9 value='70' size=1>
                10:<input type=text name=h10 value='70' size=1>
                11:<input type=text name=h11 value='75' size=1>
                12:<input type=text name=h12 value='75' size=1>
                13:<input type=text name=h13 value='75' size=1>
                14:<input type=text name=h14 value='75' size=1>
                15:<input type=text name=h15 value='80' size=1>
                16:<input type=text name=h16 value='80' size=1>
                17:<input type=text name=h17 value='80' size=1>
                18:<input type=text name=h18 value='80' size=1>
                <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                19:<input type=text name=h19 value='80' size=1>
                20:<input type=text name=h20 value='80' size=1>
                21:<input type=text name=h21 value='80' size=1>
                22:<input type=text name=h22 value='85' size=1>
                23:<input type=text name=h23 value='85' size=1>
                24:<input type=text name=h24 value='85' size=1>
                25:<input type=text name=h25 value='85' size=1>
                26:<input type=text name=h26 value='85' size=1>
                27:<input type=text name=h27 value='85' size=1>
                28:<input type=text name=h28 value='90' size=1>
                29:<input type=text name=h29 value='90' size=1>
                30:<input type=text name=h30 value='90' size=1>
                31:<input type=text name=h31 value='95' size=1>
                32:<input type=text name=h32 value='100' size=1>
                <hr>
                打分基数:
                命中打分:<input type=text value=1 size=1 name="bhits" >&nbsp;
                标题命中:<input type=text value=20 size=1 name="bfhits" >&nbsp;
                句子命中:<input type=text value=1 size=1 name="bphrase" >&nbsp;
                句子词长:<input type=text value=1 size=1 name="bnterm" >&nbsp;
                分类加权:<input type=text value=50 size=1 name="bxcatup" >&nbsp;
                分类降权:<input type=text value=200 size=1 name="bxcatdown" >&nbsp;
                rank基数:<input type=text value=10000000 size=10 name="brank" >&nbsp;
                <hr>
                    排序方法:
                    &nbsp;<input type=radio name='qfunc' value='1' checked=true>binary
                    &nbsp;<input type=radio name='qfunc' value='2'>xtree
                    &nbsp;&nbsp;相关性计算:<input type=checkbox name='rel' checked>
                    &nbsp;&nbsp;完全匹配:<input type=checkbox name='booland' checked>
                    &nbsp;&nbsp;debug:<input type=checkbox name='debug'>
                    <hr>
                    &nbsp;&nbsp;
                    想查找:<input type=text name='query' size=48 >
                    &nbsp;&nbsp;
                    不包含:<input type=text name='not_str' size=16 >
                    &nbsp;&nbsp;
                    <input name=submit type=submit value='找'><br>
                    </form>
                    </td>
                    </tr>
                    <tr>
                        <td height=200 ><div id='resinfo' ></div></td>
                    </tr>
                    <tr>
                    <td height=40 ><div id='pagetop' ></div></td>
                    </tr>
                    <tr>
                    <td><div id='records' ></div></td>
                    </tr>
                    <tr>
                        <td height=40><div id='page' ></div></td>
                    </tr>
                </table>
                <hr>
                </td>
            </tr>
        </table>
    </div>
    </div>
    <div id='nodeform'>
        <form name='nodeform' action='javascript:void(0);' onsubmit='return NodeEdit(this);'>
            <span class='closetxt' onclick="CloseThis(this)" >关闭</span>
            <input type=hidden name='op' value=1 >
            <input type=hidden name='nodeid' value=-1 >
            <select name='type' onchange="changePort(this.form);">
                <option value='-1' selected>选择类别</option>
                <option value='1' >ParserNode</option>
                <option value='2' >DocNode</option>
                <option value='4' >IndexNode</option>
            </select> 
            &nbsp;&nbsp;
            IP:<input type=text size=20 name='ip' >:<input type=text size=8 name='port' >
            &nbsp;&nbsp;
            连接数:<input type=text size=8 name='limit'>
            &nbsp;&nbsp;
            <input type=submit value='Add'>
    </form>
    </div>
</body>
</html>
